/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Engine2D.level.tile;

import Engine2D.entity.Entity;
import Engine2D.graphics.GLSpriteSheet;
import Engine2D.level.Level;
import Engine2D.graphics.GLImage;

/**
 *
 * @author gary.morris
 */
public class Tile {

  

    /**
     * 
     */
    public final byte id;
    /**
     * 
     */
    public GLSpriteSheet image = null;
    /**
     * 
     */
    public final int sizeX;
    /**
     * 
     */
    public final int sizeY;
    
    /**
     * 
     * @param id
     * @param sizeX
     * @param sizeY
     */
    public Tile(int id, int sizeX, int sizeY) {

        this.sizeX = sizeX;
        this.sizeY = sizeY;
        
        this.id = (byte) id;
        if (TileManager.tiles[id] != null) {
            throw new RuntimeException("Duplicate tile ids!");
        }
        TileManager.addTile(this, id);
        
        

    }

    /**
     * 
     * @param level
     * @param x
     * @param y
     */
    public void render(Level level, int x, int y, int xt, int yt) {
    }

    

    /**
     * 
     * @return
     */
    public boolean use() {
        return false;
    }

    /**
     * 
     */
    public void steppedOn() {
    }

    /**
     * 
     * @return
     */
    public boolean interactWith() {
        return false;
    }

    /**
     * 
     * @param level
     * @param x
     * @param y
     * @param e
     * @return
     */
    public boolean mayPass(Level level, int x, int y, Entity e) {
        return true;
    }

    /**
     * 
     * @param level
     * @param x
     * @param y
     * @param entity
     * @param damage
     * @param dir
     */
    public void hurt(Level level, int x, int y, Entity entity, int damage, char dir) {
    }

    /**
     * 
     * @param level
     * @param x
     * @param y
     * @param e
     */
    public void bumped(Level level, int x, int y, Entity e) {
    }

    /**
     * 
     * @param level
     * @param xt
     * @param yt
     */
    public void tick(Level level, int xt, int yt) {
    }

    /**
     * 
     * @param aThis
     * @param x
     * @param y
     * @return
     */
    public int getLightRadius(Level aThis, int x, int y) {
        return 0;
    }
}
